# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=artyfx
pkgver=1.3.1
pkgrel=2
pkgdesc="A plugin bundle of artistic real-time audio effects"
arch=(loong64 x86_64)
url="http://openavproductions.com/artyfx/"
license=(GPL2)
groups=(
  lv2-plugins
  pro-audio
)
depends=(
  cairo
  gcc-libs
  glibc
  libx11
  lv2-host
)
makedepends=(
  cmake
  libsndfile
  lv2
)
source=(https://github.com/openAVproductions/openAV-$pkgname/archive/release-$pkgver/$pkgname-release-$pkgver.tar.gz)
sha512sums=('7fe84783f460e5ac62d715990a7140259b8e2f1e0a531cf6cde63dadfb51e934abd17c81a8c280699279c0af2aa74ee05e073d32539d99fa37d83a0b1cfc0c49')
b2sums=('cd858f64743529084130b5b4d8851ddddd8d69d8aada3a63e0634a41057390e858e5c5d7591fc45cea2c46644a6a3bd086d3ce5cac73bc61e94cd28f7046cc06')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D BUILD_GUI=ON
    -D BUILD_SSE=ON
    -S openAV-ArtyFX-release-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  depends+=(
    libsndfile libsndfile.so
  )

  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 openAV-ArtyFX-release-$pkgver/{CHANGELOG,README.md} -t "$pkgdir/usr/share/doc/$pkgname"
}
